<%@page import="com.xnx3.j2ee.Global"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>  
<%@ taglib uri="http://www.xnx3.com/java_xnx3/xnx3_tld" prefix="x" %>
<jsp:include page="/wm/common/head.jsp">
	<jsp:param name="name" value="订单内商品列表"/>
</jsp:include>
<script src="/<%=Global.CACHE_FILE %>Order_state.js"></script>
<style>
	h2{
		padding-top: 12px;
	    padding-bottom: 5px;
	}
</style>

<div style="margin-top: 10px; text-align: center;">
<h2>订单内商品</h2>
<table class="layui-table iw_table" style="color: black;font-size: 14px;">
	<thead>
		<tr>
			<th style="text-align:center;">商品分类</th>
			<th style="text-align:center;">商品名称</th>
			<th style="text-align:center;">物品图片</th>
			<th style="text-align:center;">商品单价(元)</th>
			<th style="text-align:center;">重量(kg)</th>
			<th style="text-align:center;">商品总价(元)</th>
		</tr>
	</thead>
	<tbody id="tbody">
		<tr>
			<td style="text-align:center;">{goodsTypeName}</td>
			<td style="text-align:center;">{title}</td>
			<td><a href="{image}" target="_blank"><img style="width: 50px;height: 50px" src="{image}"></img></a></td>
			<td style="text-align:center;">{price}</td>
			<td style="text-align:center;">{number}</td>
			<td style="text-align:center;">{priceUnits}</td>
			
			
		</tr>
	</tbody>
</table>
</div>
<script type="text/javascript">
//自适应弹出层大小
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引

//列表的模版
var goodsListTemplate = document.getElementById("tbody").innerHTML;
function goodsListDate(item){
	return goodsListTemplate
		.replace(/\{goodsid\}/g, item.goodsid)
		.replace(/\{title\}/g, item.title)
		.replace(/\{priceUnits\}/g, item.money/100)
		.replace(/\{number\}/g, item.number/1000)
		.replace(/\{image\}/g, item.image)
		.replace(/\{goodsTypeName\}/g, item.goodsTypeName)
		.replace(/\{price\}/g, item.price/100)
		;
}
msg.loading('加载中');
var id = getUrlParams('id');
post('/agency/order/orderDetails.json?id='+ id,{},function(data){
	msg.close();    //关闭“更改中”的等待提示
	checkLogin(data);	//验证登录状态。如果未登录，那么跳转到登录页面
	if(data.result == '1'){
		//列表
		var html = '';
		for(var index in data.goodsList){
			var item = data.goodsList[index];
			html = html + goodsListDate(item);
		}
		document.getElementById("tbody").innerHTML = html;
	}
});
</script>
<jsp:include page="/wm/common/foot.jsp"></jsp:include>